{include file="common/head"/}
<div class="layui-fluid"><div class="layui-card"><div class="layui-card-body">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>会员结构图</legend>
    </fieldset>
	
	<div class="demoTable">
        <a href="{:url('index')}" class="layui-btn">返回</a>
    </div>
	<br/>
    <div id="myDiagramDiv" style="width:100%; height:600px; background-color:#efefef;"></div>
</div>
</div>
</div>


{include file="common/foot"/}
<script src="__ADMIN__/js/go.js"></script>
<script>
    var $ = go.GraphObject.make;
	var myDiagram =
	  $(go.Diagram, "myDiagramDiv",
		{
		  initialContentAlignment: go.Spot.Center, 
		  "undoManager.isEnabled": true, // 打开 Ctrl-Z 和 Ctrl-Y 撤销重做功能
		  layout: $(go.TreeLayout, {angle: 90, layerSpacing:35})
		});

	// 我们早先定义的模板
	myDiagram.nodeTemplate =
	  $(go.Node, "Horizontal",{ background: "#009688" },
	  //$(go.Picture,{ margin: 10, width: 50, height: 50, background: "red" },
	 // new go.Binding("source")),
	  $(go.TextBlock, "Default Text",
		  { margin: 12, stroke: "white", font: "16px" },
		  new go.Binding("text", "name"))
	  );

	// 定义一个直角路由形式的连线模板, 去掉箭头
	myDiagram.linkTemplate =
	  $(go.Link,
		{ corner: 5 },
		$(go.Shape, { strokeWidth: 3, stroke: "#555" }));

	var model = $(go.TreeModel);
	model.nodeDataArray = {$tree};
	myDiagram.model = model;
</script>
</body>
</html>